<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Check Login Status Test</title>
    <script>
        async function testCheckLogin() {
            try {
                const resultElement = document.getElementById('result');
                resultElement.textContent = '正在请求...';
                
                const response = await fetch('/check-login', {
                    method: 'GET',
                    credentials: 'same-origin'
                });
                
                if (!response.ok) {
                    resultElement.textContent = `请求失败: ${response.status} ${response.statusText}`;
                    return;
                }
                
                const data = await response.json();
                resultElement.textContent = `响应结果: ${JSON.stringify(data)}`;
                console.log('响应结果:', data);
            } catch (error) {
                console.error('请求发生错误:', error);
                document.getElementById('result').textContent = `请求发生错误: ${error.message}`;
            }
        }
    </script>
</head>
<body>
    <h1>Check Login Status Test</h1>
    <button onclick="testCheckLogin()">测试 /check-login 接口</button>
    <div id="result" style="margin-top: 20px;"></div>
</body>
</html>